import axios from "axios";

let axiosInstance = axios.create({
    // headers:{
    //     "token":localStorage.getItem('token')
    // }
})

axiosInstance.interceptors.request.use(function (config) {
    // 在发送请求之前做些什么
    //console.log("我是请求拦截器",localStorage.token)
    if (localStorage.token){
        config.headers.token = localStorage.token
    }
    return config;
}, function (error) {
    // 对请求错误做些什么
    return Promise.reject(error);
});


export default axiosInstance